﻿using System.Windows.Media;
using Utils;

namespace StockAnalyst2.Chart
{
	internal class SeriesOptions : PropertyChangedNotifier, ICloneable<SeriesOptions>, ICopyable<SeriesOptions>
	{
		#region Attributes

		private bool _isEnabled;
		private int _parameter1Value;
		private Brush _color;
		private int _thickness;
		private bool _drawArea;
		private Brush _areaColor;

		#endregion

		#region Properties

		public bool IsEnabled
		{
			get
			{
				return _isEnabled;
			}
			set
			{
				if (_isEnabled != value)
				{
					_isEnabled = value;
					base.OnPropertyChanged("IsEnabled");
				}
			}
		}

		public int Parameter1Value
		{
			get
			{
				return _parameter1Value;
			}
			set
			{
				if (_parameter1Value != value)
				{
					_parameter1Value = value;
					base.OnPropertyChanged("Parameter1Value");
				}
			}
		}

		public Brush Color
		{
			get
			{
				return _color;
			}
			set
			{
				if (_color != value)
				{
					_color = value;
					base.OnPropertyChanged("Color");
				}
			}
		}

		public int Thickness
		{
			get
			{
				return _thickness;
			}
			set
			{
				if (_thickness != value)
				{
					_thickness = value;
					base.OnPropertyChanged("Thickness");
				}
			}
		}

		public bool DrawArea
		{
			get
			{
				return _drawArea;
			}
			set
			{
				if (_drawArea != value)
				{
					_drawArea = value;
					base.OnPropertyChanged("DrawArea");
				}
			}
		}

		public Brush AreaColor
		{
			get
			{
				return _areaColor;
			}
			set
			{
				if (_areaColor != value)
				{
					_areaColor = value;
					base.OnPropertyChanged("AreaColor");
				}
			}
		}

		#endregion

		#region Public Methods

		public SeriesOptions Clone()
		{
			SeriesOptions result = new SeriesOptions();

			result.Copy(this);

			return result;
		}

		public void Copy(SeriesOptions source)
		{
			this.IsEnabled = source.IsEnabled;
			this.Parameter1Value = source.Parameter1Value;
			this.Color = source.Color;
			this.Thickness = source.Thickness;
			this.DrawArea = source.DrawArea;
			this.AreaColor = source.AreaColor;
		}

		#endregion
	}
}
